﻿using System.Collections.Generic;
using System.Threading.Tasks;
using System;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using VoL.Domain.Dtos.Workforce;
using VoL.Domain.IServices;
using VOL.Core.ManageUser;
using VOL.Core.Utilities;
using VOL.Entity.DomainModels;

namespace VOL.WebApi.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class WorkforceController : ControllerBase
    {
        private readonly IWorkforceService _workforceService;

        public WorkforceController(IWorkforceService workforceService)
        {
            _workforceService = workforceService;
        }
        /// <summary>
        /// 添加排班管理
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<WebResponseContent> AddWorkforeces([FromBody]List<Workforce> list)
        {
            return await _workforceService.AddWorkforeces(list);
        }
        /// <summary>
        /// 查询护士表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<WebResponseContent> GetNurseList()
        {
            return await _workforceService.GetNurseList();
        }
        /// <summary>
        /// 查询排版管理
        /// </summary>
        /// <param name="year"></param>
        /// <param name="month"></param>
        /// <param name="stage"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<WebResponseContent> GetWorkforces(int year, int month, int stage)
        {
          return await _workforceService.GetWorkforces(year, month, stage);
        }
        /// <summary>
        /// 查询排版明细
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<WebResponseContent> GetWorkforcesDetail(GetWorkforceDetailDto obj)
        {
            return await _workforceService.GetWorkforcesDetail(obj);
        }
        /// <summary>
        /// 修改排版管理
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<WebResponseContent> UpdWorkforeces(List<Workforce> list)
        {
            return await _workforceService.UpdWorkforeces(list);
        }

    }
}
